package com.ruoyi.departure.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.departure.mapper.DepartureMapper;
import com.ruoyi.departure.domain.Departure;
import com.ruoyi.departure.service.IDepartureService;

/**
 * 车次Service业务层处理
 * 
 * @author qingshi
 * @date 2021-06-13
 */
@Service
public class DepartureServiceImpl implements IDepartureService 
{
    @Autowired
    private DepartureMapper departureMapper;

    /**
     * 查询车次
     * 
     * @param id 车次ID
     * @return 车次
     */
    @Override
    public Departure selectDepartureById(Long id)
    {
        return departureMapper.selectDepartureById(id);
    }

    /**
     * 查询车次列表
     * 
     * @param departure 车次
     * @return 车次
     */
    @Override
    public List<Departure> selectDepartureList(Departure departure)
    {
        return departureMapper.selectDepartureList(departure);
    }

    /**
     * 新增车次
     * 
     * @param departure 车次
     * @return 结果
     */
    @Override
    public int insertDeparture(Departure departure)
    {
        departure.setCreateTime(DateUtils.getNowDate());
        return departureMapper.insertDeparture(departure);
    }

    /**
     * 修改车次
     * 
     * @param departure 车次
     * @return 结果
     */
    @Override
    public int updateDeparture(Departure departure)
    {
        departure.setUpdateTime(DateUtils.getNowDate());
        return departureMapper.updateDeparture(departure);
    }

    /**
     * 批量删除车次
     * 
     * @param ids 需要删除的车次ID
     * @return 结果
     */
    @Override
    public int deleteDepartureByIds(Long[] ids)
    {
        return departureMapper.deleteDepartureByIds(ids);
    }

    /**
     * 删除车次信息
     * 
     * @param id 车次ID
     * @return 结果
     */
    @Override
    public int deleteDepartureById(Long id)
    {
        return departureMapper.deleteDepartureById(id);
    }
}
